﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ItemControlExample
{
    public class MainWindowViewModel : ObservableObject
    {
        public ObservableCollection<DataModel> DataItems { get; set; }

        public MainWindowViewModel()
        {
            DataItems = new ObservableCollection<DataModel>();
            DataItems.Add(
                new DataModel
                {
                    Id = 1,
                    Name = "张三",
                    Desc = "Id:1,Name:张三",
                    X = 100,
                    Y = 100,
                }
            );
            DataItems.Add(
                new DataModel
                {
                    Id = 2,
                    Name = "李四",
                    Desc = "Id:2,Name:李四",
                    X = 100,
                    Y = 200,
                }
            );
            DataItems.Add(
                new DataModel
                {
                    Id = 3,
                    Name = "王五",
                    Desc = "Id:3,Name:王五",
                    X = 300,
                    Y = 150,
                }
            );
        }
    }
}
